package cn.project.test.domian;

import cn.project.domain.strategy.service.armory.IStrategyArmory;
import cn.project.domain.strategy.service.armory.IStrategyDispatch;
import lombok.extern.slf4j.Slf4j;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.annotation.Resource;

/**
 * @author xu
 * @description
 * @date 2025/7/7
 */
@Slf4j
@RunWith(SpringRunner.class)
@SpringBootTest
public class StrategyArmoryDispatchTest {
    @Resource
    private IStrategyArmory strategyArmory;
    @Resource
    private IStrategyDispatch strategyDispatch;

    @Test
    public void assembleLotteryStrategy() {
        strategyArmory.assembleLotteryStrategy(100001L);

    }

    @Test
    public void getRandomAwardId() {
        log.info("测试结果{}-奖品ID值",strategyDispatch.getRandomAwardId(100002L));
        log.info("测试结果{}-奖品ID值",strategyDispatch.getRandomAwardId(100002L));
        log.info("测试结果{}-奖品ID值",strategyDispatch.getRandomAwardId(100002L));
    }
    @Test
    public void getRandomAwardId_ruleWeightValues() {
        log.info("测试结果{}-奖品ID值",strategyDispatch.getRandomAwardId(100001L,"60:102,103,104,105"));
        log.info("测试结果{}-奖品ID值",strategyDispatch.getRandomAwardId(100001L,"200:106,107"));
        log.info("测试结果{}-奖品ID值",strategyDispatch.getRandomAwardId(100001L,"1000:105"));
    }

}
